The Catalan counties (Catalan: Comtats catalans, IPA: [kumˈtats kətəˈɫans]) were the administrative divisions of the eastern Carolingian Marca Hispanica created after its Frankish conquest. The various counties roughly defined what came to be known as the Principality of Catalonia.
In 778, Charlemagne led his first expedition into Hispania. The territory that he subjugated to his rule was the kernel of Catalonia. In 781, he created his son Louis the Pious King of Aquitaine with the mandate to defend and extend the southern border against the Moors. In 785, Rostaing was made Count of Girona, the first of the established Catalan counties. In 797, in the greatest military triumph of his long career, the young Louis took Barcelona, the greatest city of the Catalan littoral. In 798, Urgell, Osona, and Cerdanya were established under Borrell. In 801, the greatest of the counties, Barcelona, was established under Bera.
Barcelona soon overshadowed the other counties in importance, especially through the reign of Wilfred the Hairy in the late ninth century. At that time, the power of the Carolingians was waning and the neglected Hispanic march was practically independent of royal authority. In the early eleventh century, Berenguer Ramon I, Count of Barcelona, was able to submit to Sancho III of Navarre as his suzerain, even though he was still legally a vassal of Robert II of France. With the accession of Robert's father, Hugh Capet, the first non-Carolingian king, in 987, most of the Catalan counts had refused to do homage to the new dynasty. In the next century, most of the Catalan counties would come into the hands of the counts of Barcelona. They, in their own turn, would marry the heiress of Aragon, Petronilla, and unite their county to that kingdom, creating the Crown of Aragon. Several of the later kings re-created some Catalan counties as appanages for younger sons.